package com.zmqmzs;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class test03 {
    public static void main(String[] args) {
        ArrayList<String> list1 = new ArrayList<>();
        ArrayList<String> list2 = new ArrayList<>();
        Collections.addAll(list1,"P1","P2","P3","P4","P5","P6");
        int count = list1.size();
        for (int i = 0; i < 10; i++) {
            System.out.println("==========第"+i+"轮==========");
            for (int j = 0; j < count; j++) {
                Random r = new Random();
                int index = r.nextInt(list1.size());
                String name = list1.remove(index);
                list2.add(name);
                System.out.println(name);
            }
            list1.addAll(list2);
            list2.clear();
            Collections.shuffle(list1);
        }
    }
}
